package com.kuang.functionalInterface;

import java.util.function.Supplier;

/**
 * Supplier 供给型接口
 *      只有返回，乜有输入，不用吃东西，只产出是啥！爷爷的爱
 */
public class Test4 {
    public static void main(String[] args) {
        Supplier<Integer> supplier = new Supplier<Integer>(){
            @Override
            public Integer get() {
                return 1024;
            }
        };
        System.out.println(supplier.get());

        // lambda简化
        Supplier<String> supplier1 = ()->{return "test";};
        System.out.println(supplier1.get());
    }
}
